package Controllers;

import java.util.ArrayList;

import Models.CheckedOutException;
import Models.CredCheckError;
import Models.Desk;
import Models.Equipment;

public class DeskController {

	Desk desk;
	
	public DeskController(){
		desk = new Desk();
	}

	public void addUser(String netID, int roomNum, String first, String last,
			boolean isRA, String workerID) throws CredCheckError {
		desk.addUser(netID, roomNum, first, last, isRA, workerID);
	}

	public boolean removeUser(String netID, String workerID){
		return desk.removeUser(netID, workerID);
	}

	public void addEquipment(String name, int checkOutDays, String workerID) throws CredCheckError {
		desk.addEquipment(name, checkOutDays, workerID);
	}

	public boolean removeEquipment(int ID, String workerID) throws CredCheckError {
		return desk.removeEquipment(ID, workerID);
	}

	public ArrayList<Equipment> search(String query) {
		return desk.search(query);
	}

	public ArrayList<Equipment> overdueEquipment() {
		return desk.overdueEquipment();
	}

	public Equipment selectEquipment(int ID) {
		return desk.selectEquipment(ID);
	}

	public void checkOut(String netIDStudent, String netIDWorker, int ID) throws CredCheckError, CheckedOutException {
		desk.checkOut(netIDStudent, netIDWorker, ID);
	}

	public void extendCheckOut(String netIDWorker, int ID) throws CredCheckError {
		desk.extendCheckOut(netIDWorker, ID);
	}

	public ArrayList<Integer> userHistory(String netID) {
		return desk.userHistory(netID);
	}
	
	public void checkIn(String netIDWorker, int ID) throws CredCheckError{
		desk.checkIn(netIDWorker, ID);
	}
	
}
